const Logger = require('mini-logger')
const os = require('os')

/**
 * 使用全局变量global.logger
 * categories:
 *    debug:                    调试信息
 */
module.exports.onLoad = function (logDir) {
  global.logger = Logger({
    dir: logDir,
    categories: ['api', 'back'],
    format: '[{category}.]YYYY-MM-DD[.log]',
    stdout: true,
    timestamp: false,
    seperator: os.EOL
  })
}
